cmake_minimum_required(VERSION 2.8)

# Cross-Compiler
#set(CMAKE_C_COMPILER "arm-none-linux-gnueabi-gcc")
#set(CMAKE_CXX_COMPILER "arm-none-linux-gnueabi-g++")

project(BLUEDROID)

add_definitions("-fPIC -D_GNU_SOURCE -DHAS_BDROID_BUILDCFG -DOS_GENERIC")
add_definitions("-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))")
add_definitions("-DBUILDCFG -std=c99")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -std=c99 -Wall -fdata-sections -ffunction-sections")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -std=c99 -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-exceptions")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2")
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
#set(CMAKE_MODULE_LINKER_FLAGS)
#set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--gc-sections")
#set(CMAKE_STATIC_LINKER_FLAGS)

# add headers directories
include_directories(include vnd)

# add_subdirectory(audio_a2dp_hw)
add_subdirectory(bta)
add_subdirectory(btcore)
add_subdirectory(device)

# embdrv for SBC encoder and decoder
#add_subdirectory(embdrv/src)

add_subdirectory(gki)
add_subdirectory(hci)
add_subdirectory(main)
add_subdirectory(osi)
add_subdirectory(profile)
add_subdirectory(stack)

#add_subdirectory(service)
#add_subdirectory(udrv)
add_subdirectory(utils)
add_subdirectory(vendor_libs/linux)


# bdroid test
add_subdirectory(test/bluedroidtest)
add_subdirectory(test/suite)
add_subdirectory(tools/bdtool)
add_subdirectory(tools/hci)
